import Manong from "manong";
import * as functions from "./common/function.js";
import middleware from "./common/middleware.js";
import config from "./config.js";
// 导入 nuxt.config.js
import nuxtConfig from '../nuxt.config.js';

const files = include("./controllers", false, /.js$/);

const model = include("./modules", true, /.js$/);

const {controllers, modules} = getCommonData(files, model);

new Manong({
    middleware: middleware,
    controllers: controllers,
    modules: modules,
    functions: functions,
    config: {
        ...config,
        nuxt: nuxtConfig
    },
    nuxt: true
}).run();
